import { getItem, removeItemAll } from 'common/storage'
import { removeAllCookie } from 'common/auth'

export default function () {
  let loginUrl = getItem('loginUrl')
  loginUrl = decodeURIComponent(loginUrl)
  removeItemAll()
  removeAllCookie()
  if (loginUrl && loginUrl !== 'undefined') {
    window.location.href = loginUrl
  } else {
    window.location.href = 'login.html'
  }
}
